<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="kalipaltkalip" styleClass="edit">

        <rich:panel>
            <f:facet name="header">#{kalipaltkalipHome.managed ? 'Edit' : 'Add'} Kalipaltkalip</f:facet>



            <s:decorate id="altkalipadetField" template="layout/edit.xhtml">
                <ui:define name="label">Altkalipadet</ui:define>
                <h:inputText id="altkalipadet"
                       required="true"
                          value="#{kalipaltkalipHome.instance.altkalipadet}">
                    <a:support event="onblur" reRender="altkalipadetField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>




            <div style="clear:both">
                <span class="required">*</span>
                required fields
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Save"
                         action="#{kalipaltkalipHome.persist}"
                       disabled="#{!kalipaltkalipHome.wired}"
                       rendered="#{!kalipaltkalipHome.managed}"/>

            <h:commandButton id="update"
                          value="Save"
                         action="#{kalipaltkalipHome.update}"
                       rendered="#{kalipaltkalipHome.managed}"/>

            <h:commandButton id="delete"
                          value="Delete"
                         action="#{kalipaltkalipHome.remove}"
                      immediate="true"
                       rendered="#{kalipaltkalipHome.managed}"/>

            <s:button id="cancelEdit"
                   value="Cancel"
             propagation="end"
                    view="/Kalipaltkalip.xhtml"
                rendered="#{kalipaltkalipHome.managed}"/>

            <s:button id="cancelAdd"
                   value="Cancel"
             propagation="end"
                    view="/#{empty kalipaltkalipFrom ? 'KalipaltkalipList' : kalipaltkalipFrom}.xhtml"
                rendered="#{!kalipaltkalipHome.managed}"/>

        </div>
    </h:form>

<rich:tabPanel switchType="ajax">

    <rich:tab label="Kalip by altkalipid *" labelClass="required">
    <div class="association" id="altKalipParent">

        <h:outputText value="There is no altKalip associated with this kalipaltkalip."
                   rendered="#{kalipaltkalipHome.instance.altKalip == null}"/>

        <rich:dataTable var="_kalip"
                   value="#{kalipaltkalipHome.instance.altKalip}"
                rendered="#{kalipaltkalipHome.instance.altKalip != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="altKalipTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_kalip.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Ad</f:facet>
                <h:outputText value="#{_kalip.ad}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Agirlik</f:facet>
                <h:outputText value="#{_kalip.agirlik}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Firma id</f:facet>
                <h:outputText value="#{_kalip.firma.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Kod</f:facet>
                <h:outputText value="#{_kalip.kod}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Olcubirim id</f:facet>
                <h:outputText value="#{_kalip.olcubirim.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Setmi</f:facet>
                <h:outputText value="#{_kalip.setmi}"/>
            </h:column>
        </rich:dataTable>

        <div class="actionButtons">
            <s:button id="#{kalipaltkalipHome.instance.altKalip != null ? 'changeParent' : 'selectParent'}" value="#{kalipaltkalipHome.instance.altKalip != null ? 'Change' : 'Select'} altKalip"
                       view="/KalipList.xhtml">
                <f:param name="from" value="KalipaltkalipEdit"/>
            </s:button>
        </div>

    </div>
    </rich:tab>

    <rich:tab label="Kalip by kalipid *" labelClass="required">
    <div class="association" id="kalipParent">

        <h:outputText value="There is no kalip associated with this kalipaltkalip."
                   rendered="#{kalipaltkalipHome.instance.kalip == null}"/>

        <rich:dataTable var="_kalip"
                   value="#{kalipaltkalipHome.instance.kalip}"
                rendered="#{kalipaltkalipHome.instance.kalip != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="kalipTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_kalip.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Ad</f:facet>
                <h:outputText value="#{_kalip.ad}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Agirlik</f:facet>
                <h:outputText value="#{_kalip.agirlik}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Firma id</f:facet>
                <h:outputText value="#{_kalip.firma.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Kod</f:facet>
                <h:outputText value="#{_kalip.kod}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Olcubirim id</f:facet>
                <h:outputText value="#{_kalip.olcubirim.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Setmi</f:facet>
                <h:outputText value="#{_kalip.setmi}"/>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
